<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<!-- <li><a href="{:U('index')}">评选管理</a></li> -->
			<li class="active"><a href="javascript:;">基础设置</a></li>
		</ul>
		<form action="{:U('edit')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data">
			<div class="row-fluid">
				<div class="span9">
					<table class="table table-bordered">
						<tr>
							<th>标题</th>
							<td>
								<input type="hidden" name="id" value="{$info.id}">
								<input type="text" style="width: 400px;" name="post[title]" required value="{$info.title}" placeholder="请输入标题"/>
								<span class="form-required">*</span>
							</td>
						</tr>
						<tr>
							<th>删除全部文件和数据</th>
							<td>
								<input type="password" id='del-pwd' style="width: 200px;" placeholder='请输入密码'  />
								<a href="{:U('emptyAll')}" class="btn btn-primary btn-small empty" data-msg="你确定删除全部数据吗？">删除</a>
							</td>
						</tr>
						<tr>
							<th>清空投票分数数据</th>
							<td>
								<input type="password" id='del-pwd' style="width: 200px;" placeholder='请输入密码'  />
								<a href="{:U('emptyAllRating')}" class="btn btn-primary btn-small empty" data-msg="你确定清空全部数据吗？">清空</a>
							</td>
						</tr>
					</table>
				</div>

			</div>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
			</div>
		</form>
	</div>
	<script>
	 Wind.use('artDialog', function () {
		$('.empty').click(function(){
			event.preventDefault();
			var pwd = $(this).siblings('input#del-pwd').val();
			var href = $(this).attr('href');
			var icon = '';
			if (pwd == '') {
				art.dialog({   
					content: '请输入密码',
					icon: 'warning',
					ok: function () {   
						this.title('请输入密码');   
						return true;   
					}
				}); 
				return false;
			}
            $.ajax({
            	
            	url:href,
            	data:{'pwd':pwd},
            	type:'post',
            	success:function(data){
            		
	                if (data.state === 'success') {
	                	icon ='succeed';
	                }else{
	                	icon = 'warning';
	                }
	                
					art.dialog({   
						content: data.info,
						icon: icon,
						ok: function () {   
							return true;   
						}
					}); 
            	}
            	
            })
			
			return false;
		})
	 })
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>